<?
    /* -*- Mode: PHP5; tab-width: 4; indent-tabs-mode: nil; basic-offset: 4 -*- */

    /*********************************************************
    *            --== InArch ==--
    *
    * @author Kulikov Alexey <a.kulikov@gmail.com>
    * @version n/a
    * @since 12.10.2005
    * @copyright essentialmind.com 2005
    *
    *********************************************************/
    
    /***
    * Class clientNodeFolder
    ****
    * This classs represents a folder
    ****
    * @package clientNodes
    * @author A Kulikov <a.kulikov@gmail.com>
    * @version n/a
    * @since 12.10.2005
    * @copyright essentialmind.com 2005
    ***/
    class clientNodeTagCloud extends clientNode{
        
        
        /**
         * Process inputs
         * 
         * @return void 
         **/
        public function process(){
            $data          = $this->db->getRow("SELECT * FROM node_tag_cloud WHERE id = ".$this->object);
            $data['title'] = $this->db->getOne("SELECT title FROM objectmap WHERE version = 1 AND nodeid = ".$this->node);
            $data['tags']  = $this->db->getAll("SELECT name, url, count(tag_page_map.page_id) AS weight FROM tags 
                                                                 LEFT JOIN tag_page_map ON tags.id = tag_page_map.tag_id
                                                                 GROUP BY tags.id, tags.name, tags.url
                                                                 ORDER BY name");
            
            $this->smarty->assign('data',$data);
            
        }
        
        /**
         * set the action template
         * 
         * @return void
         **/
        public function setTemplate(){
            $this->setActionTemplate('tagCloud.html');
        }                        
    }
?>